//
//  RTEmotionPageCell.swift
//  Weibo
//
//  Created by Brisinga on 16/3/14.
//  Copyright © 2016年 Root. All rights reserved.
//

import UIKit

class RTEmotionPageCell: UICollectionViewCell {
    
    var indexPath: NSIndexPath? {
    
        didSet{
        
            label.text = "第\(indexPath!.section)组,第\(indexPath!.item)页"
        }
    }
    
    // 按钮数组
    private lazy var emotionButtons: [RTEmotionButton] = [RTEmotionButton]()
    
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        // 初始化内部组件
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    private func setupUI() {
    
        
        backgroundColor = UIColor.whiteColor()
        
        contentView.addSubview(label)
        
        label.snp_makeConstraints { (make) -> Void in
            
            make.center.equalTo(contentView)
        }
    }
    
    
    // 添加表情按钮
    private func addEmotionButtons() {
    
        for _ in 0..<RTEmotionPageCount {
        
            let button = RTEmotionButton()
            
            button.addTarget(self, action: "emotionBtnDidClick:", forControlEvents: UIControlEvents.TouchUpInside)
            
            button.titleLabel?.font = UIFont.systemFontOfSize(35)
            
            contentView.addSubview(button)
            
            emotionButtons.append(button)
        
        }
        
    }
    
    
    // 布局按钮
    override func layoutSubviews() {
        super.layoutSubviews()
        
        
    }
    
    private lazy var label: UILabel = {
        let label = UILabel(textColor: UIColor.darkGrayColor(), textFont: 35)
      
        return label
    }()
}
